home *** CD-ROM | disk | FTP | other *** search
/ Sun Solutions 1997 April to September / Sun Solutions CD - APR '97 - SEP '97 (704-3778-12 Rev. H)(Sun Microsystems, Inc.)(1997).iso / products / SCO / _install / su.sh < prev   
Linux/UNIX/POSIX Shell Script  |  1997-02-25  |  1KB  |  51 lines

  1. #!/bin/sh
  2. #-----------------------------------------------------------------------------
  3. #-----------------------------------------------------------------------------
  4.  
  5.  
  6. echo "
  7.  
  8. Thank you for choosing to install SCO Software.
  9. "
  10. #
  11. # Check if root
  12. #
  13. if [ "$USER" = "root" ]; then
  14. while true
  15. do
  16.   echo "Would you like to Continue install or Quit ? [y/q] \c"
  17.  
  18.   read ans
  19.   case "$ans" in
  20.         y|Y|yes|YES) exec $COMPANY_DIR/_install/install;exit 0
  21.             ;;
  22.         N|Q|n|q|No|quit|NO|QUIT|Quit) echo;echo;echo "   cancelling installation"; sleep 5 ; exit 1
  23.             ;;
  24.         * ) echo ; echo ; echo "Please answer with y if you wish to install,"
  25.                    echo "   or q if you wish to quit (stop the install)"
  26.             ;;
  27.   esac
  28. done
  29.  
  30. else
  31. while true
  32. do
  33.   echo "You need to be super user to install this software. \c"
  34.   echo ""
  35.   echo "Would you like to Continue install, or Quit ? [y/q] \c"
  36.  
  37.   read ans
  38.   case "$ans" in
  39.         y|Y|yes|YES) echo "";echo "Enter super user \c";su root -c '$COMPANY_DIR/_install/install';exit 0
  40.             ;;
  41.         N|Q|n|q|No|quit|NO|QUIT|Quit) echo;echo;echo "   cancelling installation"; sleep 5 ; exit 1
  42.             ;;
  43.         * ) echo ; echo ; echo "Please answer with y if you wish to install,"
  44.                    echo "   or q if you wish to quit (stop the install)"
  45.             ;;
  46.   esac
  47. done
  48.  
  49.  
  50. fi
  51.